import Vue from 'vue';
/* import {} from '@/types' */
/*
 * props
 */
export namespace N_cScadaView {
  // eslint-disable-next-line no-shadow
  export enum V_ecBoxProtocol {
    S7TCP = 0,
    McTCP,
    ModbusTCP,
    OPCUA
  }
  // eslint-disable-next-line no-shadow
  export enum V_ecReadWrite {
    ReadAndWrite = 0,
    Read,
    Write
  }
  // eslint-disable-next-line no-shadow
  export enum V_ecDatatype {
    Float32 = 0,
    Float64,
    Int8,
    Int16,
    Int32,
    Int64,
    UInt8,
    UInt16,
    UInt32,
    UInt64,
    DateTime,
    Date,
    Time,
    Bool,
    String,
    Bit
  }
  // eslint-disable-next-line no-shadow
  export enum V_ecBoxType {
    NOTSET = 0,
    MITSUBISHI_PLC_Q,
    SIEMENS_PLC_S7_1500,
    SIEMENS_PLC_S7_200_SMART
  }

  export interface I_ecBoxDet {
    id: string;
    code: string;
    title: string;
    dataType: V_ecDatatype;
    readWrite: V_ecReadWrite;
    val: string;
    err: string;
    timestamp: string;
    highlight?: boolean;
  }

  export interface I_ecBox {
    id: string;
    ecCode: string;
    title: string;
    model: string;
    protocol: V_ecBoxProtocol;
    ipAddr: string;
    port: number;
    type: V_ecBoxType;
    searchTerm?: string;
    ecBoxDet: I_ecBoxDet[];
  }

  export interface I_getEcBoxResp {
    success: boolean;
    msg: string;
    data: {
      driveParams: any[];
      ecBox: any;
    };
  }
  export interface I_readResp {
    success: boolean;
    msg: string;
    data: Map<
      string,
      {
        dataType: V_ecDatatype;
        controllerType: V_ecBoxType;
        val: any;
        err: string;
      }
    >;
  }
  export interface I_qryDataResp {
    success: boolean;
    msg: string;
    // data: Map<
    //   string,
    //   {
    //     d: Array<{ t: string; v: any }>;
    //     total: number;
    //   }
    // >;
    data: string;
  }

  export interface I_qryDataReq {
    ecCodes: string[];
    beginTime: string;
    endTime: string;
    pageNo: number;
    pageSize: number;
  }

  export interface cScadaView extends Vue {}
}
